import 'package:flutter/cupertino.dart';

class FadePageRoute extends PageRouteBuilder{
  final Widget widget;

  FadePageRoute(this.widget):super(
      transitionDuration: Duration(milliseconds: 500),
      pageBuilder: (context, anim, _) => widget,
      transitionsBuilder: (context, anim, _, child) => FadeTransition(
        opacity: Tween(begin: 0.0, end: 1.0).animate(CurvedAnimation(parent: anim, curve: Curves.ease)),
        child: child,
      ));
}